package com.ruoyi.site.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.site.mapper.OrderItemsMapper;
import com.ruoyi.site.domain.OrderItems;
import com.ruoyi.site.service.IOrderItemsService;

/**
 * 订单项目Service业务层处理
 *
 * @author chuckeytang
 * @date 2025-08-17
 */
@Service
public class OrderItemsServiceImpl implements IOrderItemsService
{
    @Autowired
    private OrderItemsMapper orderItemsMapper;

    /**
     * 查询订单项目
     *
     * @param orderItemId 订单项目主键
     * @return 订单项目
     */
    @Override
    public OrderItems selectOrderItemsByOrderItemId(Long orderItemId)
    {
        return orderItemsMapper.selectOrderItemsByOrderItemId(orderItemId);
    }

    /**
     * 查询订单项目列表
     *
     * @param orderItems 订单项目
     * @return 订单项目
     */
    @Override
    public List<OrderItems> selectOrderItemsList(OrderItems orderItems)
    {
        return orderItemsMapper.selectOrderItemsList(orderItems);
    }

    /**
     * 根据订单ID查询订单项目列表
     *
     * @param orderId 订单ID
     * @return 订单项目集合
     */
    @Override
    public List<OrderItems> selectOrderItemsListByOrderId(Long orderId) {
        return orderItemsMapper.selectOrderItemsListByOrderId(orderId);
    }

    /**
     * 新增订单项目
     *
     * @param orderItems 订单项目
     * @return 结果
     */
    @Override
    public int insertOrderItems(OrderItems orderItems)
    {
        return orderItemsMapper.insertOrderItems(orderItems);
    }

    /**
     * 修改订单项目
     *
     * @param orderItems 订单项目
     * @return 结果
     */
    @Override
    public int updateOrderItems(OrderItems orderItems)
    {
        return orderItemsMapper.updateOrderItems(orderItems);
    }

    /**
     * 批量删除订单项目
     *
     * @param orderItemIds 需要删除的订单项目主键
     * @return 结果
     */
    @Override
    public int deleteOrderItemsByOrderItemIds(Long[] orderItemIds)
    {
        return orderItemsMapper.deleteOrderItemsByOrderItemIds(orderItemIds);
    }

    /**
     * 删除订单项目信息
     *
     * @param orderItemId 订单项目主键
     * @return 结果
     */
    @Override
    public int deleteOrderItemsByOrderItemId(Long orderItemId)
    {
        return orderItemsMapper.deleteOrderItemsByOrderItemId(orderItemId);
    }
}
